//----------from对像---------------------
var NKMousRightMenu = Class.create({
    version: '1.0',
    initialize : function(id,muid,ahid) {
    	this.id = id;//表单id
    	this.muid=muid;
    	this.ahid = !ahid;//自动隐藏
    	this.dobj =$(this.id);
    	this.npointer = {left:0,top:0};
    },
    //--------------表单初始化------------------------------------------------------
    show : function(){
    	var self = this;
    	self.initDiv();//绝对定位
    },
    initDiv : function(){
    	var self = this;
    	var isFind = false;
    	var dv = self.dobj;
    	dv.absolutize();//绝对定位
    	dv.observe('mousemove',function(event){//在提交数据的时候进行验证
    		isFind = true;
        });
    	dv.observe('mouseout',function(event){//在提交数据的时候进行验证
    		isFind = false;
    		setTimeout(function(){
    			if(!isFind && self.ahid){
    				dv.hide();
    			}
    		},500);
        });
    	dv.nshow = function(x,y){
    		if(x!=undefined && y!=undefined){
    			self.npointer = {left:x,top:y};
    			dv.absolutize();
        		dv.setStyle({left:x+'px',top:y+'px'});
    			dv.show();
    			isFind=true;
    		}
    	};
    	dv.PointerLeft = function(){//获取坐标
    		return self.npointer.left;
    	};
    	dv.PointerTop = function(){//获取坐标
    		return self.npointer.top;
    	};
    	$$('#'+self.id+' div[id^="'+self.id+'_DIV_"]').each(function(alink,index) {
    		if(index==0)
    			alink.setStyle({color:'#000000',backgroundColor:'#ffffff',border:'solid 1px #9955FF'});
    		else
    			alink.setStyle({color:'#000000',backgroundColor:'#ffffff',borderBottom:'solid 1px #9955FF',borderLeft:'solid 1px #9955FF',borderRight:'solid 1px #9955FF'});
    		alink.observe('mousemove',function(event){//在提交数据的时候进行验证
        		self.setSelectStyle(this);
            });
    		alink.observe('mouseout',function(event){//在提交数据的时候进行验证
        		self.setNoSelectStyle(this);
            });
    	});
    },
   //----------选种状态-----------------------
    setSelectStyle : function(obj){
    	obj.setStyle({color:'#ffffff',backgroundColor:'#000080'});
    },
    //-----------未选种状态-------------------
    setNoSelectStyle : function(obj){
    	obj.setStyle({color:'#000000',backgroundColor:'#ffffff'});
    }
});